import { formatDate } from '@/utils/day'
import type { FormItemRows, TableColums } from '@meetjs/element-plus-kit'

export const formOptionsBase: FormItemRows[] = [
	{
		type: 'input',
		label: '用户名称',
		prop: 'userName'
	},
	{
		type: 'input',
		label: '手机号码',
		prop: 'phoneNumber'
	},
	{
		type: 'select',
		label: '状态',
		prop: 'status',
		attrs: {
			style: 'width: 200px'
		},
		options: []
	},
	{
		type: 'date-picker',
		label: '创建时间',
		prop: 'daterange',
		attrs: {
			type: 'daterange',
			startPlaceholder: '开始时间',
			endPlaceholder: '结束时间',
			valueFormat: 'YYYY-MM-DD HH:mm:ss'
		}
	}
]

export const columnsBase: TableColums[] = [
	{
		type: 'index',
		label: '序号',
		align: 'center',
		width: 60
	},
	{
		label: '用户编号',
		prop: 'id'
	},
	{
		label: '用户名称',
		prop: 'userName'
	},
	{
		label: '用户昵称',
		prop: 'nickName'
	},
	{
		label: '部门',
		prop: 'dept.deptName'
	},
	{
		label: '手机号码',
		prop: 'phoneNumber',
		width: '120px'
	},
	{
		label: '状态',
		prop: 'status',
		type: 'slot'
	},
	{
		label: '创建时间',
		prop: 'createTime',
		width: '160px',
		formatter: row => formatDate(row.createTime)
	},
	{
		prop: 'action',
		fixed: 'right',
		label: '操作',
		width: '260px',
		align: 'center'
	}
]
